<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSystemUserTable extends Migration
{
    public function up()
    {
        Schema::create('system_user', function (Blueprint $table) {
            $table->increments('id');
            $table->string('username', 30)->default('');
            $table->string('nickname', 30)->default('');
            $table->string('password', 255)->default('');
            $table->string('token', 32)->default('');
            $table->tinyInteger('status', false, true)->default(0);
            $table->timestamp('logged_at')->nullable();
            $table->integer('logged_ip', false, true)->default(0);
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('system_user');
    }
}
